import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const constantRouterMap = [
    {
        path:'/',
        name:'首页',
        component:()=>import('@/front/Index')
    },
    {
        path:'/list/:id',
        name:'列表页面',
        component:()=>import('@/front/List')
    },
    {
        path:'/detail/:id',
        name:'详情页面',
        component:()=>import('@/front/Detail')
    },
    {
        path:'/post_list',
        name:'详情页面',
        component:()=>import('@/front/PostList')
    },
    {
        path:'/com_info/:id',
        name:'企业详情',
        component:()=>import('@/front/CompanyInfo')
    },
    {
        path:'/post_info/:id',
        name:'职位详情',
        component:()=>import('@/front/PostInfo')
    },
    {
        path:'/login',
        name:'login',
        component:()=>import('@/views/Login')
    },
    {
        path:'/reg',
        name:'reg',
        component:()=>import('@/front/Reg')
    }
]

const createRouter = ()=> new VueRouter({
routes:constantRouterMap
})
const  router = createRouter();
export default router

export function resetRouter() {
    const newRouter = createRouter();
    router.matcher = newRouter.matcher;
}
